﻿<%@ Page Language="C#" MasterPageFile="~/Workflow/MasterPage/Edit.Master"  AutoEventWireup="true"  CodeBehind="WF_VarTemplate_Edit.aspx.cs" Inherits="Honestysoft.Baseframework.WebUI.Workflow.WFConfigure.WF_VarTemplate_Edit"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	
<script language="javascript" type="text/javascript">
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
					<%= txtName.UniqueID%>:{required: true,maxlength: 200},
					<%= ddlType.UniqueID%>:{required: true},
					<%= ddlDataType.UniqueID%>:{required: true}					
                 },
                 messages:
                 {
					<%= txtName.UniqueID%>:{required: "变量名称 请输入合适的值",maxlength: "变量名称 最多只能输入200个字符"},
					<%= ddlType.UniqueID%>:{required: "变量类型 请选择合适的值"},
					<%= ddlDataType.UniqueID%>:{required: "数据类型 请选择合适的值"}					
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>* "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
        function setValueType(value){
            document.getElementById("<%=txtCalendar.ClientID %>").style.display='none';
            document.getElementById("<%=txtIniValue.ClientID %>").style.display='none';
            document.getElementById("<%=rblBoolean.ClientID %>").style.display='none';
            document.getElementById("<%=numValue.ClientID %>").style.display='none';
            if(value == '<%=((int)Honestysoft.Workflow.Model.WFEnumData.DataType.CharType).ToString() %>'){
                document.getElementById("<%=txtIniValue.ClientID %>").style.display='block';
            }
            else if(value == '<%=((int)Honestysoft.Workflow.Model.WFEnumData.DataType.NumType).ToString() %>'){
                document.getElementById("<%=numValue.ClientID %>").style.display='block';
            }
            else if(value == '<%=((int)Honestysoft.Workflow.Model.WFEnumData.DataType.DateType).ToString() %>'){
                document.getElementById("<%=txtCalendar.ClientID %>").style.display='block';
            }
            else if(value == '<%=((int)Honestysoft.Workflow.Model.WFEnumData.DataType.BooleanType).ToString() %>'){
                document.getElementById("<%=rblBoolean.ClientID %>").style.display='block';
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">流程变量维护</th>
        </table>
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit">
		<tr>
			<td style="width:80px;" class="title1">变量名称</td>
			<td><asp:TextBox ID="txtName" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
            
			<td class="title1">变量类型</td>
			<td><asp:DropDownList ID="ddlType" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
		</tr>
		<tr>
			<td class="title1">数据类型</td>
			<td><asp:DropDownList ID="ddlDataType" runat="server" cssClass="input2"  Width="98%" onchange="setValueType(this.value);"></asp:DropDownList></td>
            <td class="title1">初始值</td>
			<td>
                <asp:TextBox ID="txtCalendar" runat="server" CssClass="input2"  onfocus="setday(this);" style="display:none" Width="96%"  ></asp:TextBox>
                <asp:TextBox ID="txtIniValue" runat="server"  CssClass="input2" MaxLength="200" Width="96%" ></asp:TextBox>
                <asp:RadioButtonList ID="rblBoolean" runat="server" RepeatColumns="2" RepeatLayout="Flow"  style="display:none" >
                    <asp:ListItem Selected="True" Value="true" Text="true"></asp:ListItem>
                    <asp:ListItem Value="false" Text="false"></asp:ListItem>
                </asp:RadioButtonList>
                <asp:TextBox ID="numValue" runat="server"  style="display:none"   cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox>
            </td>
		</tr>
		<tr>
			
			<td class="title1">备注</td>
			<td colspan="3"><asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine"  cssClass="input2" MaxLength="500" Width="96%"></asp:TextBox></td>
		</tr>
        </table>
        <div class="save_area">
            <asp:Button runat="server" ID="btnOK" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" onclick="btnOK_Click"/>
            <input type="button" id="btnExit" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
</asp:Content>


